package com.yuanye.gwcit.fragments;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.yuanye.gwcit.R;
import com.yuanye.yeecho.base.BaseFragment;

public class HdmiInFragment extends BaseFragment {

    private static final String TAG = HdmiInFragment.class.getSimpleName();
    public HdmiInFragment() {
        setTaskName("HDMI输入");
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        hideTestButton();
        View view = inflater.inflate(R.layout.frag_hdmiin, container, false);
        return view;
    }

    @Override
    public void onResume() {
        super.onResume();
        if (!isHidden()){
            new AlertDialog.Builder(getContext())
                    .setMessage("HDMI IN测试是否通过？")
                    .setPositiveButton("通过", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            passAndNext();
                        }
                    })
                    .setNegativeButton("失败", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            setFail();
                        }
                    })
                    .setCancelable(false)
                    .show();
        }

    }

    @Override
    public void execTask() {
    }

    @Override
    public void stopTask() {

    }

}
